from machine import Pin,SPI
from ssd1351 import Display
import camera
spi = SPI(2, baudrate=14500000, sck=Pin(2), mosi=Pin(14))
display = Display(spi, dc=Pin(15), cs=Pin(13), rst=Pin(12),width=128,height=128)
camera.init(0,format=0)

ee=camera.capture().resize(128,96)#修改大小 128X128的屏幕没买，手头上只有128x96屏幕
ee.draw_line((10,10,20,30),color=[255,255,255]) #线段元组 x1 y1 x2 y2
ee.draw_rectangle((24,47,20,30),color=[155,55,55])#矩形元组x y w h
ee.draw_circle(50,40,30,color=[255,255,255]) #x y r
ee.draw_cross(80,50,size=15,color=[255,255,255]) #x y 十字线段长度
ee.draw_string(70,10,"openmv esp32",color=[255,255,255])
display.draw_image_ram(ee.to_bytes(), 0, 30, 128, 96)
